package com.lzs.esubscribe.utils;

import com.alibaba.druid.filter.config.ConfigTools;
import org.springframework.stereotype.Component;

/**
 * @author : liangzesheng
 * @Date : 2022-02-17
 * @Description : 加解密工具类
 */
@Component
public class EncryptUtils {
    /**
     * 描述：
     *
     * @author chenfei
     * @date 2021/9/9
     */
    public void decrypt() {
        String password = "Ry1HEFxrbd421lXHFbZRXl5jd20ezKc6uSRe86KirmrUtzLP0zvyB8Hh+m3Ozn5sV9YmFcSI34kYyqtt6EoIHw==";
        String publicKey = "MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAIgo3ohinGYbQpoPqMrKpFIRFHEW5ViO/dbL4Cxn3unRP87KOMimIfUp43hk4hI74On7vJrElzrrJZZHRsNz+7kCAwEAAQ==";
        try {
            String decrypt = ConfigTools.decrypt(publicKey, password);
            System.out.println(decrypt);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public static void main(String[] args) {
        String str = "机构代码21";
        str = str.substring(4,6);
        System.out.println(str);
    }
}

